package com.wu.service.impl;

import com.wu.base.BaseService;
import com.wu.dao.ShiroUserDao;
import com.wu.entity.ShiroUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author wuyanshen
 * @date 2019-01-13 11:36 AM
 * @discription 描述
 */
@Service
@Transactional(readOnly = false, rollbackFor = Exception.class)
public class UserService extends BaseService<ShiroUserDao,ShiroUser> {

//    public ShiroUser find(ShiroUser shiroUser) {
//        //使用Shiro Session可以拿到controller中Session存的数据
//        Session session = SecurityUtils.getSubject().getSession();
//        String value = (String) session.getAttribute("key");
//        System.out.println("session 中的值:" + value);
//        System.out.println("查询user");
//        ShiroUser user = super.dao.get(shiroUser);
//        return user;
//    }

    public String getRoleIdByLoginName(String loginName) {
        return null;
    }

    public ShiroUser getUserByLoginName(String loginName) {
        ShiroUser shiroUser = super.dao.getUserByLoginName(loginName);
        return shiroUser;
    }
}
